package com.dm.cloud.images.service;

import com.alibaba.fastjson2.JSONObject;
import com.dm.cloud.images.common.mode.ImageMode;
import com.dm.cloud.images.common.mode.ImageTag;
import com.dm.cloud.images.mode.fileupload.ImageUploadMerge;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface RepositoryServerService {
    /**
     * 上传镜像
     * @param file
     * @return
     */
    Object uploadImage(MultipartFile file);

    /**
     * 查询镜像列表
     * @param page
     * @param page_size
     * @param sort
     * @param q
     * @return
     */
    List<ImageMode> searchImages(Integer page, Integer page_size, String sort, String q);

    /**
     * 删除镜像
     * @param imageName
     * @return
     */
    Boolean deleteImage(String imageName);

    List<ImageTag> imageTags(String imageName);

    Boolean deleteTag(String digest,String imageName, String tag);

    /**
     * 合并镜像文件并上传
     * @param fileUploadMerge
     * @return
     */
    String imageShardMerge(ImageUploadMerge fileUploadMerge);

    /**
     * tag的详情
     * @param imageName 镜像名称
     * @param sha256Ids sha256Id
     * @return
     */
    JSONObject tagDetail(String imageName, String sha256Ids);
}
